package fr.unice.client.services;

import java.util.List;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

import fr.unice.client.AudioFile;
import fr.unice.client.PlaylistDTO;

/**
 * The client side stub for the Playlist RPC service.
 * 
 * @author PELLEGRINO Laurent
 * @author TROVATO Alexandre
 * 
 * @version 1.0
 */
@RemoteServiceRelativePath("playlist")
public interface PlaylistService extends RemoteService {
	/**
	 * Adds a new playlist in the database.
	 * 
	 * @param name
	 *            the name of the playlist.
	 */
	public Long addPlaylist(String name);

	/**
	 * Retrieves all playlists from the database.
	 * 
	 * @return all playlists from the database.
	 */
	public List<PlaylistDTO> getPlaylists();

	/**
	 * Removes a playlist from database by id.
	 * 
	 * @param id
	 *            the identifier to use in order to remove the playlist.
	 */
	public void removePlaylist(Long id);

	/**
	 * Updates the playlist name in the database for the given id.
	 * 
	 * @param id
	 *            the identifier of the playlist.
	 * @param newName
	 *            the new name to set.
	 */
	public void updatePlaylist(Long id, String newName);

	/**
	 * Adds an {@link AudioFile} on the given playlist.
	 * 
	 * @param playlistID
	 *            the playlist to which we want to add an audio file.
	 * @param audioFileID
	 *            the identifier of the audio file to add.
	 */
	public void addAudioFileToPlaylist(Long playlistID, String audioFileID);
}
